Optimal. Leaf size=108 \[ \frac {4 i a^4 \tan (c+d x)}{d}-\frac {8 a^4 \log (\cos (c+d x))}{d}-8 i a^4 x+\frac {\left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\frac {a (a+i a \tan (c+d x))^3}{3 d}+\frac {(a+i a \tan (c+d x))^4}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {3527, 3478, 3477, 3475} \[ \frac {4 i a^4 \tan (c+d x)}{d}+\frac {\left (a^2+i a^2 \tan (c+d x)\right )^2}{d}-\frac {8 a^4 \log (\cos (c+d x))}{d}-8 i a^4 x+\frac {a (a+i a \tan (c+d x))^3}{3 d}+\frac {(a+i a \tan (c+d x))^4}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3477
Rule 3478
Rule 3527
Rubi steps
\begin {align*} \int \tan (c+d x) (a+i a \tan (c+d x))^4 \, dx &=\frac {(a+i a \tan (c+d x))^4}{4 d}-i \int (a+i a \tan (c+d x))^4 \, dx\\ &=\frac {a (a+i a \tan (c+d x))^3}{3 d}+\frac {(a+i a \tan (c+d x))^4}{4 d}-(2 i a) \int (a+i a \tan (c+d x))^3 \, dx\\ &=\frac {a (a+i a \tan (c+d x))^3}{3 d}+\frac {(a+i a \tan (c+d x))^4}{4 d}+\frac {\left (a^2+i a^2 \tan (c+d x)\right )^2}{d}-\left (4 i a^2\right ) \int (a+i a \tan (c+d x))^2 \, dx\\ &=-8 i a^4 x+\frac {4 i a^4 \tan (c+d x)}{d}+\frac {a (a+i a \tan (c+d x))^3}{3 d}+\frac {(a+i a \tan (c+d x))^4}{4 d}+\frac {\left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\left (8 a^4\right ) \int \tan (c+d x) \, dx\\ &=-8 i a^4 x-\frac {8 a^4 \log (\cos (c+d x))}{d}+\frac {4 i a^4 \tan (c+d x)}{d}+\frac {a (a+i a \tan (c+d x))^3}{3 d}+\frac {(a+i a \tan (c+d x))^4}{4 d}+\frac {\left (a^2+i a^2 \tan (c+d x)\right )^2}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 1.26, size = 231, normalized size = 2.14 \[ -\frac {i a^4 \sec (c) \sec ^4(c+d x) \left (-38 \sin (c+2 d x)+18 \sin (3 c+2 d x)-14 \sin (3 c+4 d x)+24 d x \cos (3 c+2 d x)-12 i \cos (3 c+2 d x)+6 d x \cos (3 c+4 d x)+6 d x \cos (5 c+4 d x)-12 i \cos (3 c+2 d x) \log \left (\cos ^2(c+d x)\right )+12 \cos (c+2 d x) \left (-i \log \left (\cos ^2(c+d x)\right )+2 d x-i\right )+3 \cos (c) \left (-6 i \log \left (\cos ^2(c+d x)\right )+12 d x-7 i\right )-3 i \cos (3 c+4 d x) \log \left (\cos ^2(c+d x)\right )-3 i \cos (5 c+4 d x) \log \left (\cos ^2(c+d x)\right )+42 \sin (c)\right )}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.42, size = 174, normalized size = 1.61 \[ -\frac {4 \, {\left (30 \, a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 63 \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 50 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + 14 \, a^{4} + 6 \, {\left (a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{4}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )\right )}}{3 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 1.33, size = 222, normalized size = 2.06 \[ -\frac {4 \, {\left (6 \, a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 \, a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 36 \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 30 \, a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 63 \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 50 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + 6 \, a^{4} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 14 \, a^{4}\right )}}{3 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 101, normalized size = 0.94 \[ \frac {8 i a^{4} \tan \left (d x +c \right )}{d}+\frac {a^{4} \left (\tan ^{4}\left (d x +c \right )\right )}{4 d}-\frac {4 i a^{4} \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}-\frac {7 a^{4} \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {4 a^{4} \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}-\frac {8 i a^{4} \arctan \left (\tan \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.69, size = 82, normalized size = 0.76 \[ \frac {3 \, a^{4} \tan \left (d x + c\right )^{4} - 16 i \, a^{4} \tan \left (d x + c\right )^{3} - 42 \, a^{4} \tan \left (d x + c\right )^{2} - 96 i \, {\left (d x + c\right )} a^{4} + 48 \, a^{4} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 96 i \, a^{4} \tan \left (d x + c\right )}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.72, size = 72, normalized size = 0.67 \[ \frac {8\,a^4\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )-\frac {7\,a^4\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2}+\frac {a^4\,{\mathrm {tan}\left (c+d\,x\right )}^4}{4}+a^4\,\mathrm {tan}\left (c+d\,x\right )\,8{}\mathrm {i}-\frac {a^4\,{\mathrm {tan}\left (c+d\,x\right )}^3\,4{}\mathrm {i}}{3}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.88, size = 185, normalized size = 1.71 \[ - \frac {8 a^{4} \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {- 120 i a^{4} e^{6 i c} e^{6 i d x} - 252 i a^{4} e^{4 i c} e^{4 i d x} - 200 i a^{4} e^{2 i c} e^{2 i d x} - 56 i a^{4}}{3 i d e^{8 i c} e^{8 i d x} + 12 i d e^{6 i c} e^{6 i d x} + 18 i d e^{4 i c} e^{4 i d x} + 12 i d e^{2 i c} e^{2 i d x} + 3 i d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________